//commom 引入 方法
const city_array = require('./fenzhan.js').cityList;
//node  引入 方法
// import fenzhan from 'fenzhan.js'
// const city_array = fenzhan.cityList;


const getCity = function (options) {
  for (let a = 0; a < city_array.length; a++) {
    if (options == city_array[a].name) {
      return city_array[a].id;
    } else {
      for (let b = 0; b < city_array[a].city.length; b++) {
        if (options == city_array[a].city[b].name) {
          return city_array[a].city[b].id;
        } else {
          for (let c = 0; c < city_array[a].city[b].qu.length; c++) {
            if (options == city_array[a].city[b].qu[c].name) {
              return city_array[a].city[b].qu[c].id;
            }
          }
        }
      }
    }
  }
}
module.exports={
  getCity
}